package main

import (
    "net/http"
    "fmt"
)

func setCookie(res http.ResponseWriter, req *http.Request) {
    http.SetCookie(res, &http.Cookie{ 
        Name: "token", 
        Value: "fdsakfjdasfdasfjsa",
    })
}

func getCookie(res http.ResponseWriter, req *http.Request) {
    cookie, _ := req.Cookie("token")
    fmt.Println(cookie)
}

func main() {
    http.HandleFunc("/", setCookie)
    http.HandleFunc("/index", getCookie)
    http.ListenAndServe(":9000", nil)
}
